from django.contrib import admin

# Register your models here.

from django.contrib import admin

# Register your models here.

from .models import Provincial, AreaManage


#
# class ProvincialInline(admin.StackedInline):
#     model = Provincial
#     extra = 3

class ProvincialAdmin(admin.ModelAdmin):
    #所有字段显示需要加上[   ]
    # fields = ["__all__"]
    # fields = ["Pr_name",'parent','user']
    # 显示多个字段
    list_display = ('Pr_name','parent','user')

    # readonly_fields = ('user')
    list_filter = ('user')
    exclude = ['user']
    # 点击之后可链接编辑字段
    list_display_links = ('user',)
    # 设置过滤的列‘
    list_filter = ('parent',)  # 设置Age为过滤列


class AreaManageAdmin(admin.ModelAdmin):
    # list_display = ('Pr_name','parent','user')
    fields = ['__all__']
    list_display = ('Pr_name', 'parent',)

admin.site.register(Provincial,ProvincialAdmin)
admin.site.register(AreaManage,AreaManageAdmin)


